import Dep from './Dep.js';

export default class Watcher {
    constructor(vm, key, cb) {
        Dep.target = this
        this.vm = vm
        this.key = key
        this.cb = cb
        this.vm[this.key]
        Dep.target = null
    }

    update() {
        this.cb.call(this.vm, this.vm[this.key])
    }
} 